WIP: xpadneo, device: Fix up NUL byte before final End Collection#622
Draft
kakra wants to merge 1 commit into
Draft
WIP: xpadneo, device: Fix up NUL byte before final End Collection#622kakra wants to merge 1 commit into
kakra wants to merge 1 commit into
Conversation
Some firmwares write 0x00 where a second End Collection (0xC0) was needed to close a nested collection, followed by a correct final 0xC0. The HID parser then sees an unknown Main item instead of the closing End Collection, breaking descriptor parsing for the affected report. Replace the stray 0x00 with 0xC0 so the descriptor ends with two valid End Collections. Do not shrink the descriptor: both bytes are required to close the two open collections. TODO: - [ ] Needs descriptor dump to find and validate both opening offsets Link: atar-axis#603 Co-authored-by: GloriousEggroll <gloriouseggroll@gmail.com> Signed-off-by: Kai Krakow <kai@kaishome.de>
Contributor
|
sorry ive been away from this for a little while with other projects taking priority, which device(s) did you need descriptor dumps from? |
Collaborator
Author
|
I have two queued commits which miss descriptors as evidence for the checksums and fixups: From the C code: { .crc16 = 0x28FA, .name = "Xbox One Elite Series 2 (legacy)" },
{ .crc16 = 0x6BA1, .name = "Xbox One S 1708 (fw 0x0903, truncated rumble descriptor)" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some firmwares write 0x00 where a second End Collection (0xC0) was needed to close a nested collection, followed by a correct final 0xC0. The HID parser then sees an unknown Main item instead of the closing End Collection, breaking descriptor parsing for the affected report.
Replace the stray 0x00 with 0xC0 so the descriptor ends with two valid End Collections. Do not shrink the descriptor: both bytes are required to close the two open collections.
TODO:
Link: #603
the module source code are accepted under GPL-2.0-only.
reviews and suggestions (e.g. GitHub Copilot PR suggestions). I will not contribute commits with a
Co-authored-by signature of an AI agent because I confirm that my contribution has been verified, reviewed and
tested by a human being, and I take full responsibility as the author of the commit using my own Signed-off-by.
other interaction with AI.
@GloriousEggroll Are you able to provide the missing broken descriptor so we can implement this evidence-based?